package test;

import static org.junit.Assert.*;

import org.junit.Test;

import expression.PostfixEvaluator;


public class SaraSchlosserPETest {	
	
	@Test
	public void firstTest(){
		int answer = PostfixEvaluator.eval("1 2 +");
		//System.out.println(answer);
        assertTrue(answer == 3);
	}
	
	@Test
	public void secondTest(){
		int answer = PostfixEvaluator.eval("1 2 3 * +");
		//System.out.println(answer);
        assertTrue(answer == 7);
	}
	
	@Test
	public void thirdTest(){
		int answer = PostfixEvaluator.eval("1 2 * 3 4 * +");
		//System.out.println(answer);
        assertTrue(answer == 14);
	}
	
	@Test
	public void fourthTest(){
		int answer = PostfixEvaluator.eval("1 2 + 3 10 5 / ^ * 9 /");
		//System.out.println(answer);
        assertTrue(answer == 3);
	}
	
	@Test
	public void fifthTest(){
		int answer = PostfixEvaluator.eval("4 3 2 ^ ^");
		//System.out.println(answer);
        assertTrue(answer == 262144);
	}
	
	@Test
	public void sixthTest(){
		int answer = PostfixEvaluator.eval(" 4 1 1 + / 2 /");
		//System.out.println(answer);
        assertTrue(answer == 1);
	}
}
